﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="documentmerger">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="sourcedocuments">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="sourcedocument">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="name" type="xs:string" />
                    <xs:element name="filepath" type="xs:string" />
                    <xs:element name="pages">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" name="allpages" />
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="page">
                            <xs:complexType>
                              <xs:attribute name="number" type="xs:unsignedByte" use="optional" />
                              <xs:attribute name="content" type="xs:string" use="optional" />
                              <xs:attribute name="conent" type="xs:string" use="optional" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:string" use="required" />
                  <xs:attribute name="type" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="destinationdocuments">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="destinationdocument">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="inputdirectory" type="xs:string" />
                    <xs:element name="outputdir" type="xs:string" />
                    <xs:element name="inserts">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element maxOccurs="unbounded" name="insert">
                            <xs:complexType>
                              <xs:attribute name="betweenstart" type="xs:unsignedShort" use="required" />
                              <xs:attribute name="betweenend" type="xs:unsignedShort" use="required" />
                              <xs:attribute name="sourcedocumentid" type="xs:string" use="required" />
                              <xs:attribute name="replace" type="xs:boolean" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="extracts">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="pages">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element maxOccurs="unbounded" name="page">
                                  <xs:complexType>
                                    <xs:attribute name="number" type="xs:unsignedByte" use="required" />
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:string" use="required" />
                  <xs:attribute name="type" type="xs:string" use="required" />
                  <xs:attribute name="pagesize" type="xs:string" use="required" />
                  <xs:attribute name="docname" type="xs:string" use="optional" />
                  <xs:attribute name="newdocname" type="xs:string" use="optional" />
                  <xs:attribute name="deleteold" type="xs:boolean" use="optional" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="type" type="xs:string" use="required" />
      <xs:attribute name="created" type="xs:date" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>